<?php
require_once dirname(dirname(__FILE__)) . '/common.php';

try {
    $dal = new DataStore('fang_articles');
    $dal->truncate();

    $data = array('a_title' => 'Hello',
                  'a_content' => 'World',
                  'a_publisher' => 'Neaton',
                  'a_publisher_id' => 1);
    $id = Fang_DAO_Article::add($data);

    $res = Fang_DAO_Article::update($id, array('a_title' => 'Hello__'));

    Fang_DAO_Article::remove($id);
} catch (Exception $e) {
    echo $e->getMessage() . "\n";
}
